package com.lagou.framework.config;

import lombok.Data;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

/**
 * server.xml 配置实体
 *
 * @author srh
 * @date 2020/04/03
 **/
@Data
@Root(name = "server")
public class XmlServerConfig {

    @Element
    private Service service;

    @Data
    @Root(name = "service")
    public static class Service {
        @Element
        private Connector connector;
        @Element
        private Engine engine;
    }

    @Data
    @Root(name = "connector")
    public static class Connector {
        @Attribute
        private Integer port;
    }

    @Data
    @Root(name = "engine")
    public static class Engine {
        @Element
        private Host host;
    }

    @Data
    @Root(name = "host")
    public static class Host {
        @Attribute
        private String name;
        @Attribute
        private String appBase;
    }
}
